cmake_minimum_required(VERSION 3.5)
project(kylin-ai-sdk-demo)

set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

find_package(PkgConfig REQUIRED)
pkg_check_modules(GIO REQUIRED gio-unix-2.0)
include_directories(${GIO_INCLUDE_DIRS})

pkg_check_modules(KYSDK_AI_VISION kysdk-coreai-vision)
include_directories(${KYSDK_AI_VISION_INCLUDE_DIRS})
add_executable(coreai_vision_imagefile vision_image.cpp)

target_link_libraries(coreai_vision_imagefile
    pthread
    ${GIO_LIBRARIES}
    ${KYSDK_AI_VISION_LIBRARIES}
)

add_executable(coreai_vision_imagedata vision_image_imagedata.cpp)
target_link_libraries(coreai_vision_imagedata
    pthread
    ${GIO_LIBRARIES}
    ${KYSDK_AI_VISION_LIBRARIES}
)

pkg_check_modules(KYAISPEECH kysdk-coreai-speech)
include_directories(${KYAISPEECH_INCLUDE_DIRS})
add_executable(speech_recognizer speech_recognizer.cpp)
target_link_libraries(
    speech_recognizer
    pthread
    ${GIO_LIBRARIES}
    ${KYAISPEECH_LIBRARIES}
)

add_executable(speech_synthesizer speech_synthesizer.cpp)
target_link_libraries(
    speech_synthesizer
    pthread
    ${GIO_LIBRARIES}
    ${KYAISPEECH_LIBRARIES}
)

pkg_check_modules(Embedding REQUIRED IMPORTED_TARGET kysdk-coreai-embedding)
add_executable(coreai_embedding coreai_embedding.cpp)
target_link_libraries(coreai_embedding
    pthread
    ${GIO_LIBRARIES}
    PkgConfig::Embedding
)


pkg_check_modules(KYAINLP kysdk-genai-nlp)
include_directories(${KYAINLP_INCLUDE_DIRS})
add_executable(genai_nlp genai_nlp.cpp)
target_link_libraries(genai_nlp
    pthread
    ${GIO_LIBRARIES}
    ${KYAINLP_LIBRARIES}
)


pkg_check_modules(KYAIVISION kysdk-genai-vision)
include_directories(${KYAIVISION_INCLUDE_DIRS})
add_executable(genai_vision genai_vision.cpp)
target_link_libraries(genai_vision
    pthread
    ${GIO_LIBRARIES}
    ${KYAIVISION_LIBRARIES}
)

pkg_check_modules(KYSDK_AI_ASSISTANT kyai-assistant)
include_directories(${KYSDK_AI_ASSISTANT_INCLUDE_DIRS})
add_executable(assistant assistant.cpp)
target_link_libraries(assistant
    pthread
    ${GIO_LIBRARIES}
    ${KYSDK_AI_ASSISTANT_LIBRARIES}
)
